home *** CD-ROM | disk | FTP | other *** search
/ MacFormat España 4 / MacFormat n. 4 (Spain) / MacFormat 4.bin / La ciudad del ShareWare / Desarrollo / ICAppSourceKit1.0 / InternetConfig.p < prev    next >
Encoding:
Text File  |  1994-11-11  |  1.4 KB  |  64 lines

  1. program InternetConfig;
  2.  
  3.     uses
  4.         RequiredEventSupport, ICGlobals, ICDocument, ICEvents, ICWindows, ICInstall, ICIconSuites, ICMiscSubs;
  5.  
  6.     procedure HandleAppParams;
  7.         var
  8.             ap_file: AppFile;
  9.             fss: FSSpec;
  10.             msg, count: integer;
  11.             junk: OSErr;
  12.             err: OSErr;
  13.             junklong: longint;
  14.     begin
  15.         if has_AppleEvents then begin
  16.             junk := InitAppleEvents(@DoOpenApp, @DoOpenDoc, nil, @DoQuit);
  17.         end
  18.         else begin
  19.             CountAppFiles(msg, count);
  20.             if count <= 0 then begin
  21.                 DisplayError(acNewDocument, DoOpenApp);
  22.             end
  23.             else begin
  24.                 GetAppFiles(1, ap_file);
  25.                 ClrAppFiles(1);
  26.                 if GetWDInfo(ap_file.vRefNum, fss.vRefNum, fss.parID, junklong) = noErr then begin
  27.                     fss.name := ap_file.fName;
  28.                     DisplayError(acOpenDocument, DoOpenDoc(fss));
  29.                 end; (* if *)
  30.             end; (* if *)
  31.         end; (* if *)
  32.     end; (* HandleAppParams *)
  33.  
  34.     var
  35.         mbar: Handle;
  36.         err: OSErr;
  37.         junk: OSErr;
  38. begin
  39.     mbar := GetNewMBar(128);
  40.     if mbar = nil then begin
  41.         ExitToShell;
  42.     end; (* if *)
  43.     SetMenuBar(mbar);
  44.     AddResMenu(GetMHandle(M_Apple), 'DRVR');
  45.     DrawMenuBar;
  46.     InitGlobals;
  47.     InitMiscSubs;
  48.     InitICIconSuites;
  49.     err := InitICWindows;
  50.     if err = noErr then begin
  51.         err := InitICDocument;
  52.     end; (* if *)
  53.     if err <> noErr then begin
  54.         DisplayError(acStartApplication, err);
  55.         ExitToShell;
  56.     end; (* if *)
  57.     HandleAppParams;
  58.     InitCursor;
  59.     InitializeComponentInstalation;
  60.     while not quitnow do begin
  61.         HandleEvents;
  62.     end; (* while *)
  63.     TermICDocument;
  64. end. (* InternetConfig *)